#include<stdio.h>
#include"process.h" 

//void download()
//{
//    int rate = 0;
//    while(rate <= MAX_RATE)
//    {
//        process_v2(rate++);
//
//    }
//
//        printf("\n");
//}
//

void download(call_pro cb)
{
    int total = 0;
    int targit = TSIZE;
    int per_size = PER_SIZE;

    while(total <= targit)
    {
        usleep(TIME);
        total += per_size;
       // process_v2(total*100 / targit);
         //int rate = (total*100) / targit;
      
      int rate = (total*100) / targit;
      cb(rate);

    }

        printf("\n");
}


int main()
{
    //process_v1();
    download(process_v3);

    return 0;
}
